$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'test/unit'
require 'testcasedoc'

class TestCaseDoc < Test::Unit::TestCase

    def test_get_testcase
        tc = LWA::TestCaseDoc.new("sample_testcase.xml").get_case(3)
        assert_instance_of LWA::Testcase,tc
        File.open('sample_testcase.yaml', 'w') do |os|
          YAML::dump(tc.step_list, os)
        end
        john2 = File.open('sample_testcase.yaml') { |is|  YAML::load(is) }
        p john2
    end

    def test_get_resource
        assert_equal LWA::TestCaseDoc.new("sample_testcase.xml").get_resource("PDF_File"), "SamplePDF.pdf"
    end
end